Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
    Dim strMsg As String
    If (ApplyType = acApplyFilter Or ApplyType = _
                    acApplyServerFilter) _
                    And Len(Me.Filter) > 0 Then
        strMsg = "You have asked to filter the form " & _
            "given the following condition:"
        strMsg = strMsg & vbCrLf & vbCrLf & Me.Filter
        strMsg = strMsg & vbCrLf & vbCrLf & "Proceed?"
        If MsgBox(strMsg, vbYesNo Or vbQuestion, _
            "ApplyFilter") = vbNo Then
            Cancel = True
        End If
    ElseIf ApplyType = acShowAllRecords Or Len(Me.Filter) = 0 Then
        strMsg = "You have asked to show all the records."
        strMsg = strMsg & vbCrLf & vbCrLf & "Proceed?"
        If MsgBox(strMsg, vbYesNo Or vbQuestion, "ApplyFilter") _
            = vbNo Then
            Cancel = True
        End If
    End If
End Sub
